package Designpatterns.shizhan.calculator;

import Designpatterns.shizhan.calculator.impl.*;

public class AlgorithmFactory {
    Algorithm createOperation(String operation){
        switch (operation){
            case "+":
                return new Addition();
            case "-":
                return new Subtraction();
            case "*":
                return new Division();
            case "/":
                return new Multiplication();
            case "%":
                return new ModuloOperation();
            default:
                throw new IllegalArgumentException("请输入正确的运算符");
        }

    }
}
